@include('admin.layout.bone_header')

<div class="layui-btn-container">

</div>


<table class="layui-hide" id="think-table" lay-filter="think-table"></table>

<script type="text/html" id="barDemo">
    @{{# if(d['status'] == 0){ }}
    <a class="layui-btn layui-btn-xs" lay-event="audit">审核</a>
    @{{# } }}


</script>

<script>

    layui.use('table', function () {
        let table = layui.table;
        UI.getPageTable(table, "{{route('admin.recharge.recharge')}}", [
            {field: 'u_recharge_id', title: 'ID', width: 80, sort: true, fixed: 'left'}
            , {field: 'pay_usdt', title: '下单金额'}
            , {field: 'order_sn', title: '订单号'}
            , {field: 'user_id', title: '用户id'}
            , {field: 'rdatasource', title: '充值源'}
            , {field: 'address', title: '付款地址'}
            , {field: 'status', title: '状态',templet:function (d){
                    let arr = ['未处理','已通过','已拒绝'];
                    return arr[d['status']];
                }}
            ,{fixed: 'right',title:'操作', align:'center', toolbar: '#barDemo'}
        ]);

        table.on('tool(think-table)', function (obj) {
            let data = obj.data;
            if(obj.event === 'audit') {
                UI.openLayer("{{route('admin.recharge.audit')}}?u_recharge_id="+data['u_recharge_id'],400,400);
            }
        });
        let $ = layui.$, active = {
            reload:function (){
                UI.openLayer("{{route('admin.recharge.sys_name')}}",400,400);
            }
        };
        $('.layui-btn-container .layui-btn').on('click', function () {
            let type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

        $('.search .layui-btn').on('click', function () {
            let type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    })


</script>


@include('admin.layout.bone_footer')
